public class Test {
    public String name ;
    public int num ;

    public Test(){

        System.out.println("没有参数的构造方法");
    }
    public Test(String name , int num){
        this.name = name ;
        this.num = num ;
        System.out.println("两个参数的构造方法");
    }
    public void print(){
        System.out.println("输出对象成员变量");
        this.setTest("狗子" , 1);
        System.out.println(" 名字" + this.name + " 编号" +this.num);
    }

   public void setTest(String name , int num){
       this.name = name ;
       this.num = num ;
   }

    public static void main(String[] args) {
        Test test = new Test() ;
        test.print();
    }


}
